home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_0399 / 393 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  1.9 KB

  1. Date: Thu, 22 Jul 1993 13:48:29 +0200
  2. Message-Id: <199307221148.AA11357@sun.ph-cip.uni-koeln.de>
  3. To: mint@atari.archive.umich.edu
  4. From: hessdorf@ph-cip.uni-koeln.de (Joerg Hessdoerfer)
  5. Subject: minix fs syncer
  6.  
  7. Hi all!
  8.  
  9. After several crashes of my working partition ;-( I decided to write this little
  10. utility: it sends a 'SIGALRM' to the 'update' demon of minix fs, causing it to
  11. sync tthe fs'.
  12.  
  13. SIGALRM was the natural choice, since Steven uses Talarm() to schedule fs
  14. syncing.
  15.  
  16. P.s.: I crashed my fs' cause I write a SCSI driver, which fiddles with the
  17. interrupt vectors. When this is done before a sync occured, Minix fs can't
  18. write
  19. on the partition at the next update(), so I loose...
  20. I hope, Steven includes this one (or a similar one) in his releases, since a use
  21. of this before doing anything possibly harmful (e.g. power off, reset button)
  22. might well save your work ;-))
  23.  
  24. Here's the listing:
  25. -----------------------------8<-------------------------------------------------
  26. #include <mintbind.h>
  27. #include <signal.h>
  28.  
  29. /* This is a simple minix-fs syncer. It sends SIGALRM to the
  30.    'update' process. Since this signal is captured, it causes
  31.    a sync on the fs'. */
  32.  
  33. const char update[]="U:\\proc\\update.*";
  34.  
  35. int main()
  36. {
  37.   int upid;
  38.   _DTA dta;
  39.  
  40.   Fsetdta(&dta);
  41.   if(!Fsfirst(update,0))
  42.     {
  43.       upid=atoi(&(dta.dta_name[strlen(dta.dta_name)-3]));       /* The
  44. process ID is in the 3-byte extension */
  45.       Pkill(upid,SIGALRM);
  46.       printf("update demon notified. File systems are being synced.\n");
  47.     }
  48.   else printf("No update demon running. No sync performed.\n");
  49. }
  50. -----------------------8<-------------------------------------------------------
  51. Greetings, Joe
  52.  
  53.     email: hessdorf@sun.ph-cip.uni-koeln.de
  54.                
  55.     snail mail:
  56.        Joerg Hessdoerfer  | Remember: warranty void if seal is broken!
  57.        Niehler Str. 332   | (broken seal)
  58.        BRD 5000 Koeln 60
  59.                
  60.     Telephone: (Germany) 0221/714178 (home) or 02203/6013335 (office)
  61.  
  62.